package com.bachongLightNovel.works;

import com.bachongLightNovel.model.dto.audit.AuditNovelDto;
import com.bachongLightNovel.model.vo.audit.AuditNovelVo;
import com.bachongLightNovel.works.fallback.WorksNovelClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author vermouth
 */
@FeignClient(value = "bachong-light-novel-works",fallbackFactory = WorksNovelClientFallbackFactory.class)
public interface IWorksNovelClient {

    /**
     * 获取所有待审核状态的小说列表(status==1)
     * @param :
     * @return List<AuditNovelVo>
     * @author vermouth
     */
    @GetMapping("api/works/novel/feign/get-audits")
    List<AuditNovelVo> getAuditList();


    /**
     * 设置审核状态
     * @param dto:
     * @return boolean
     * @author vermouth
     */
    @PutMapping("api/works/novel/feign/set-status")
    boolean setAuditStatus(@RequestBody AuditNovelDto dto);

    /**
     * 根据小说名获取小说id
     * @param novelName:
     * @return Long
     * @author vermouth
     */
    @GetMapping("api/works/novel/feign/get-novelId")
    List<Long> getNovelIdByNovelName(@RequestParam String novelName);

    /**
     * 根据小说id获取小说名
     * @param novelId:
     * @return String
     * @author vermouth
     */
    @GetMapping("api/works/novel/feign/get-novelName")
    String getNovelNameById(@RequestParam Long novelId);
}
